import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * The BasicEnemy is the enemy whit easy difficulty to kill.
 * 
 * @author (Arturo Aaron Rios Obregon) 
 * @version (29 june 2013)
 */
public class BasicEnemy extends Enemy
{
    private int shut;
    /**
     * Constructor
     */
    public BasicEnemy()
    {
        super(15);
        shut=0;
    }
    
    /**
     * Act - do whatever the BasicEnemy wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        super.mueve();
        super.tocaBala();
        super.creaItem();
        
        if(getMoveE()==0)
        {
            
            if(shut%3==0)
            {
                dispara();
                shut=shut%3;
                shut+=1;
                
            }
            else 
                shut+=1;
        }
        super.vidaCero();
    } 
    
    /**
     * This method create the enemy bullets
     */
    public void dispara()
    {
        BulletEnemy bala = new BulletEnemy();
        getWorld().addObject(bala,getX(),getY()+25);
    }
}
